/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package coalescent.br;

import coalescent.br.BRSKC64.BRSKC64Impl;
import coalescent.data.KC64Data.StringKC64Data;
import coalescent.model.KC64;
import coalescent.phylogeny.GeneTree;

import commons.util.graph.LeafPath;

/**
 * @author Susanta Tewari
 * @since Jan 24, 2012
 */
public class BRs {

    /**
     * Constructs ...
     *
     */
    private BRs() {}

    /**
     * Method description
     *
     *
     * @param geneTree
     *
     * @return
     */
    public static AMCElement<KC64.EventType, ?> getGeneTreeRecursion(GeneTree geneTree) {

        class GeneTreeBkdRecursion
                extends BRSK69<LeafPath<String, GeneTree.MutationEdgeData>, String, GeneTree,
                               GeneTree, GeneTreeBkdRecursion> {

            GeneTreeBkdRecursion(GeneTree statistic) {
                super(statistic);
            }

            /**
             * Method description
             *
             *
             * @param statistic
             *
             * @return
             */
            @Override
            public GeneTreeBkdRecursion factory(GeneTree statistic) {
                return new GeneTreeBkdRecursion(statistic);
            }
        }

        return new GeneTreeBkdRecursion(geneTree);
    }

    /**
     * Method description
     *
     *
     * @param data
     *
     * @return
     */
    public static AMCElement<KC64.EventType, ?> getKC64DataRecursion(StringKC64Data data) {

        class KC64DataBkdRecursion
                extends BRSKC64Impl<String, StringKC64Data, StringKC64Data, KC64DataBkdRecursion> {

            KC64DataBkdRecursion(StringKC64Data data) {
                super(data);
            }

            /**
             * Method description
             *
             *
             * @param statistic
             *
             * @return
             */
            @Override
            public KC64DataBkdRecursion factory(StringKC64Data statistic) {
                return new KC64DataBkdRecursion(statistic);
            }
        }

        return new KC64DataBkdRecursion(data);
    }
}
